<link href="http://demo.swfupload.org/v220/css/default.css" />
<style>
    td{padding:5px;}
    table th{text-align:right}
    table li{float:left;margin-right:30px;}
</style>
<div class="center">
	<div class="home">
    	<div class="home_left">
        	<?php echo $this->partial('tuan/menu.phtml',array('uCount' => $this->uCount,'menuId'=>$this->menuId,'user'=>$this->user)); ?>
        </div>
        <div class="home_right">
    <div class="fill">
        <form action="/tuan/instore" method="post">
        <table style="border:1px solid #000;width:90%">
            <caption>入库</caption>
            <tr>
                <th>仓库号</th>
                <td><?= $this->formText('storeno',null,array('class'=>'required')) ?></td>
            </tr>
            <tr>
                <th>用户信息</th>
                <td><span style="color:green" id="userinfo">输入仓库号，将会自动加载用户信息</span><?= $this->formHidden('userid') ?></td>
            </tr>
            <tr>
                <th>包裹条码</th>
                <td><?= $this->formText('barcode',null,array('class'=>'required')) ?></td>
            </tr>
            <tr>
                <th>包裹名称</th>
                <td><?= $this->formText('productName',null,array('class'=>'required')) ?></td>
            </tr>            
            <tr>
                <th>重量（克）</th>
                <td><?= $this->formText('weight',null,array('class'=>'required number')) ?></td>
            </tr>
            <tr>
                <th>产品图片</td>
                <td style="height:100px;">
                    <?= $this->formHidden('image','/pic/wu40.png') ?>
                    <div class="fieldset flash" id="fsUploadProgress">
                    <span class="legend">Upload Queue</span>
                    </div>
                    <div id="divStatus">0 Files Uploaded</div>
                    <div>
                        <span id="stt"></span>
                        <input id="btnCancel" type="button" value="Cancel All Uploads" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px;" />
                    </div>
                    <div style="position: absolute;margin-left:300px;margin-top:-100px">
                        <image id="pimage" src="/pic/wu40.png" />
                    </div>
                </td>
            </tr>            
            <tr>
                <th>物流号</th>
                <td><?= $this->formText('logistics',null,array('class'=>'required')) ?></td>
            </tr>
            <tr>
                <th>物流公司</th>
                <td><?= $this->formText('logisticName',null,array('class'=>'required')) ?></td>
            </tr>
            <tr>
                <th>是否有包装</th>
                <td><label> <?= $this->formCheckbox('isPack') ?>有包装</label></td>
            </tr>
            <tr>
                <th>去包将后重量</th>
                <td><?= $this->formText('noPackageWeight',null,array('class'=>'number')) ?></td>
            </tr>
            <tr>
                <th>是否有体积重量</th>
                <td><label> <?= $this->formCheckbox('bignessType') ?>有体积重量</label></td>
            </tr>
            <tr>
                <th>体积重量</th>
                <td><?= $this->formText('volumeWeight',null,array('class'=>'number')) ?></td>
            </tr>
            <tr>
                <th>能否真空处理</th>
                <td><label> <?= $this->formCheckbox('canVacuum') ?>能真空处理</label></td>
            </tr>
            <tr>
                <th>真空处理后体积重量</th>
                <td><?= $this->formText('vacuumWeight',null,array('class'=>'number')) ?></td>
            </tr>
            <tr>
                <th>是否禁运品</th>
                <td><label> <?= $this->formCheckbox('isEmbargo') ?>是禁运品</label></td>
            </tr>
            <tr>
                <th>产品类型</td>
                <td>
                    <ul clas="itemtype">
                        <li><label><input type="checkbox" name="itemType[]" id="itemType1" value="1">仿牌</label></li>
                        <li><label><input type="checkbox" name="itemType[]" id="itemType2" value="2">电池</label></li>
                        <li><label><input type="checkbox" name="itemType[]" id="itemType4" value="4">液体</label></li>
                        <li><label><input type="checkbox" name="itemType[]" id="itemType8" value="8">食品</label></li>
                        <li><label><input type="checkbox" name="itemType[]" id="itemType16" value="16">粉未</label></li>                        
                        <li><label><input type="checkbox" name="itemType[]" id="itemType32" value="32">膏状物</label></li>                        
                        <li><label><input type="checkbox" name="itemType[]" id="itemType64" value="64">药物</label></li>                        
                        <li><label><input type="checkbox" name="itemType[]" id="itemType128" value="128">敏感</label></li>                        
                    </ul>
                </td>
            </tr>
            <tr>
                <th></td>
                <td><input type="submit" value="  提   交  "/></td>
            </tr>
            
        </table>
            </form>
    </div>
</div>
        </div>
<script type="text/javascript" src="http://demo.swfupload.org/v220/swfupload/swfupload.js"></script>
<script type="text/javascript" src="http://demo.swfupload.org/v220/simpledemo/js/swfupload.queue.js"></script>
<script type="text/javascript" src="http://demo.swfupload.org/v220/simpledemo/js/handlers.js"></script>
<script type="text/javascript" src="http://demo.swfupload.org/v220/simpledemo/js/fileprogress.js"></script>
<script>
$(function(){
    $('#storeno').change(function(){
        $.post('/tuan/userinfo', {'storeno':$(this).val()}, function(data){
            if(!data){
                $('#userinfo').text('没有找到该仓库号对应的用户信息');
                alert('没有找到该仓库号对应的用户信息,请检查仓库号是否输入正确');
                $('#storeno').focus();
                return;
            }
            $('#userid').val(data.userid);
            $('#userinfo').text('帐号:'+data.email+' 用户ID：'+data.userid+' 昵称:'+data.nikeName);
        }, 'json');
    });
    $('form').validate();
   
});
</script>
<script type="text/javascript">
		var swfu;

		window.onload = function() {
			var settings = {
				flash_url : "/js/swfupload/swfupload.swf",
				upload_url: "/ajax/upload",
				post_params: {"PHPSESSID" : ""},
				file_size_limit : "100 MB",
				file_types : "*.jpeg;*.png;*.jpg;*.gif",
				file_types_description : "图片文件",
				file_upload_limit : 100,
				file_queue_limit : 0,
				custom_settings : {
					progressTarget : "fsUploadProgress",
					cancelButtonId : "btnCancel"
				},
				debug: false,

				// Button settings
				button_image_url: "/images/share/button.gif",
				button_width: "65",
				button_height: "29",
				button_placeholder_id: "stt",
				button_text: '<span class="theFont">上传图片</span>',
				button_text_style: ".theFont { font-size: 16; }",
				button_text_left_padding: 12,
				button_text_top_padding: 3,
				
				// The event handler functions are defined in handlers.js
				file_queued_handler : fileQueued,
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_start_handler : uploadStart,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : function(file,data){
                        
                        $('#image').val('/'+$.parseJSON(data));
                        $('#pimage').attr('src',$('#image').val());
                		var progress = new FileProgress(file, this.customSettings.progressTarget);
                        progress.setComplete();
                        progress.setStatus("Complete.");
                        progress.toggleCancel(false);
                },
				//upload_success_handler : uploadSuccess,
				upload_complete_handler : uploadComplete,
				queue_complete_handler : queueComplete	// Queue plugin event
			};

			swfu = new SWFUpload(settings);
	     };
	</script>

